package com.imooc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class GirlService {
    @Autowired
    private GirlRepository girlRepository;

    @Transactional
    public void addTwoGirl(){
        Girl girlA=new Girl();
        girlA.setCupSize("A");
        girlA.setAge(18);

        Girl girlB=new Girl();
        girlB.setCupSize("BB");
        girlB.setAge(28);

        girlRepository.save(girlA);
        girlRepository.save(girlB);
    }
}
